home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / prog_bas / tblevw.zip / WINHELP.BAS < prev   
BASIC Source File  |  1994-04-18  |  2KB  |  79 lines

  1. ' The TrueGrid Sample Application
  2.  
  3. ' WINHELP.BAS - This module contains Windows API declarations and
  4. ' utility routines that provide access to the WinHelp application.
  5.  
  6. Const HELP_CONTEXT = &H1
  7. Const HELP_HELPONHELP = &H4
  8. Const HELP_QUIT = &H2
  9.  
  10.  
  11. ' Help context IDs for sample applications
  12. Global Const HELP_TRUEBROWSER = 1000
  13. Global Const HELP_DBTABLE = 1001
  14. Global Const HELP_LINKGRID = 1002
  15. Global Const HELP_MARKGRID = 1003
  16. Global Const HELP_APPTBOOK = 1004
  17. Global Const HELP_GENLEDGR = 1005
  18. Global Const HELP_DRAGDROP = 1006
  19. Global Const HELP_EDITING = 1007
  20. Global Const HELP_DROPDOWN = 1008
  21. Global Const HELP_CALLBACK = 1009
  22. Global Const HELP_VIEWTABLE = 1010
  23.  
  24. Declare Function WinHelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, ByVal dwData As Any) As Integer
  25.  
  26. Function GetHelpFile () As String
  27.  
  28.     GetHelpFile = ""
  29.  
  30.     Wh$ = TrueGridWhere$()
  31.  
  32.     On Error GoTo tryagain
  33.     
  34.     H$ = Wh$ + "truegrid.hlp"
  35.     I$ = Dir$(H$)
  36.     GetHelpFile = H$
  37.  
  38.     Exit Function
  39.  
  40. tryagain:
  41.     H$ = App.Path + "\truegrid.hlp"
  42.     
  43.     If Dir$(H$) = "" Then
  44.         GetHelpFile = ""
  45.     Else
  46.         GetHelpFile = H$
  47.     End If
  48.     Exit Function
  49.  
  50. End Function
  51.  
  52. Sub HelpContext (This As Form, Context As Integer)
  53.  
  54. ' Display a particular frame of the TrueGrid help file, if found in
  55. ' the product installation directory or the application directory
  56.  
  57.     H$ = GetHelpFile()
  58.  
  59.     If H$ <> "" Then
  60.         Z% = WinHelp(This.hWnd, H$, HELP_CONTEXT, CLng(Context))
  61.     Else
  62.         MsgBox "Can't find TrueGrid help file", MB_ICONEXCLAMATION
  63.     End If
  64.  
  65. End Sub
  66.  
  67. Sub HelpOnHelp (This As Form)
  68.  
  69. ' Display instructions for using WinHelp
  70.  
  71.     Z% = WinHelp(This.hWnd, dummy$, HELP_HELPONHELP, CLng(0))
  72.  
  73. End Sub
  74.  
  75. Sub HelpQuit (This As Form)
  76.   R = WinHelp(This.hWnd, dummy$, HELP_QUIT, CLng(0))
  77. End Sub
  78.  
  79.